package cn.cxion.chat.kit.conversation.ext;

import android.content.Context;
import android.content.Intent;
import android.view.View;

import com.blankj.utilcode.util.ToastUtils;

import cn.cxion.chat.R;
import cn.cxion.chat.app.activity.ConstantActivity;
import cn.cxion.chat.app.util.LogUtil;
import cn.cxion.chat.kit.annotation.ExtContextMenuItem;
import cn.cxion.chat.kit.conversation.ext.core.ConversationExt;
import cn.wildfirechat.model.Conversation;

import static cn.cxion.chat.app.constant.Constant.LOVTIDENDE;

public class LovtidendeExt extends ConversationExt {

    /**
     * @param containerView 扩展view的container
     * @param conversation
     */
    @ExtContextMenuItem(title = "法律月刊")
    public void pickImage(View containerView, Conversation conversation) {
//        Intent intent = ImagePicker.picker().showCamera(true).enableMultiMode(9).buildPickIntent(context);
//        startActivityForResult(intent, 100);
//        TypingMessageContent content = new TypingMessageContent(TypingMessageContent.TYPING_CAMERA);
//        conversationViewModel.sendMessage(content);
        ToastUtils.showShort("点击法律月刊");
        ConstantActivity.show(context,LOVTIDENDE);
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        LogUtil.print("点击预约客户");
//        if (resultCode == Activity.RESULT_OK) {
//            if (data != null) {
//                //是否发送原图
//                boolean compress = data.getBooleanExtra(ImagePicker.EXTRA_COMPRESS, true);
//                ArrayList<ImageItem> images = (ArrayList<ImageItem>) data.getSerializableExtra(ImagePicker.EXTRA_RESULT_ITEMS);
//                for (ImageItem imageItem : images) {
//                    File imageFileThumb;
//                    File imageFileSource;
//                    // FIXME: 2018/11/29 压缩, 不是发原图的时候，大图需要进行压缩
////                    if (isOrig) {
//                    imageFileSource = new File(imageItem.path);
//                    imageFileThumb = ImageUtils.genThumbImgFile(imageItem.path);
////                    } else {
////                        //压缩图片
////                        // TODO  压缩的有问题
////                        imageFileSource = ImageUtils.genThumbImgFileEx(imageItem.path);
////                        //imageFileThumb = ImageUtils.genThumbImgFile(imageFileSource.getAbsolutePath());
////                        imageFileThumb = imageFileSource;
////                    }
//                    conversationViewModel.sendImgMsg(imageFileThumb, imageFileSource);
//                }
//            }
//        }
    }

    @Override
    public int priority() {
        return 100;
    }

    @Override
    public int iconResId() {
        return R.mipmap.lovtidende;
    }

    @Override
    public String title(Context context) {
        return "法律月刊";
    }
}
